package com.cloud.api.upms.feign;

import com.cloud.common.core.constant.ServiceNameConstants;
import com.cloud.common.core.result.Result;
import com.cloud.common.satoken.core.domain.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Author:  xuanning
 * Date:    2022/10/29 1:50
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UMPS)
public interface RemoteUserService {

    /**
     * 通过用户名查询用户、角色信息
     * @param username 用户名
     * @RequestParam 必须使用要不然feign内部可能会转换成post方法去掉接口
     * @return Result
     */
    @GetMapping("/user/info")
    Result<LoginUser> info(@RequestParam("username") String username);

    /**
     * 通过手机号码查询用户、角色信息
     * @param phone 手机号码
     * @return Result
     */
    @GetMapping("/user/info/phone")
    Result<LoginUser> infoByPhone(@RequestParam("phone") String phone);

}
